using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CrimeAnalysisandSafetyTools
{
    /// <summary>
    /// <para>Add Date Attributes</para>
    /// <para>Adds fields containing date or time properties from an input date field, for example, day full name, day of the month, month, and year.</para>
    /// <para>从输入日期字段添加包含日期或时间属性的字段，例如，日全名、月日、月和年。</para>
    /// </summary>    
    [DisplayName("Add Date Attributes")]
    public class AddDateAttributes : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddDateAttributes()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The layer or table that contains the field with the date values that need to be extracted.</para>
        /// <para>包含包含需要提取的日期值的字段的图层或表。</para>
        /// </param>
        /// <param name="_date_field">
        /// <para>Date Field</para>
        /// <para>The date field from which data and time properties will be extracted to populate the new field values.</para>
        /// <para>将从中提取数据和时间属性以填充新字段值的日期字段。</para>
        /// </param>
        public AddDateAttributes(object _in_table, object _date_field)
        {
            this._in_table = _in_table;
            this._date_field = _date_field;
        }
        public override string ToolboxName => "Crime Analysis and Safety Tools";

        public override string ToolName => "Add Date Attributes";

        public override string CallName => "ca.AddDateAttributes";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_in_table, _date_field, _date_attributes, _out_table];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The layer or table that contains the field with the date values that need to be extracted.</para>
        /// <para>包含包含需要提取的日期值的字段的图层或表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Date Field</para>
        /// <para>The date field from which data and time properties will be extracted to populate the new field values.</para>
        /// <para>将从中提取数据和时间属性以填充新字段值的日期字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Date Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _date_field { get; set; }


        /// <summary>
        /// <para>Date Attributes</para>
        /// <para><xdoc>
        ///   <para>Specifies the date and time properties and fields that will be added to the input table.</para>
        ///   <bulletList>
        ///     <bullet_item>Output Time Format—The date or time property to be added to the Output Field Name.</bullet_item><para/>
        ///     <bullet_item>Output Field Name—The name of the field that will be added to the input table.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>Output Time Format options are as follows:</para>
        ///   <bulletList>
        ///     <bullet_item>Hour—The hour value between 0 and 23.</bullet_item><para/>
        ///     <bullet_item>Day Full Name—The full name of the day of the week, for example, Wednesday.</bullet_item><para/>
        ///     <bullet_item>Month—The month value between 1 and 12.</bullet_item><para/>
        ///     <bullet_item>Day of the Month—The day of the month value between 1 and 31.</bullet_item><para/>
        ///     <bullet_item>Year——The year value in yyyy format, for example, 1983.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将添加到输入表中的日期和时间属性和字段。</para>
        ///   <bulletList>
        ///     <bullet_item>输出时间格式 - 要添加到“输出字段名称”的日期或时间属性。</bullet_item><para/>
        ///     <bullet_item>输出字段名称 - 将添加到输入表中的字段的名称。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>输出时间格式选项如下：</para>
        ///   <bulletList>
        ///     <bullet_item>小时 - 介于 0 和 23 之间的小时值。</bullet_item><para/>
        ///     <bullet_item>日期全名 - 星期几的全名，例如星期三。</bullet_item><para/>
        ///     <bullet_item>月- 介于 1 和 12 之间的月份值。</bullet_item><para/>
        ///     <bullet_item>月中日—月中日期值介于 1 和 31 之间。</bullet_item><para/>
        ///     <bullet_item>Year——yyyy 格式的年份值，例如 1983 年。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Date Attributes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _date_attributes { get; set; } = null;


        /// <summary>
        /// <para>Updated Input Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_table { get; set; }


        public AddDateAttributes SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}